body {
  margin: 0;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  background-color: #f5f5f5;
}

.container {
  max-width: 800px;
  margin: 40px auto;
  padding: 0 20px;
}

.inputForm {
  margin-bottom: 30px;
}

.scheduleInput {
  width: 100%;
  padding: 15px 20px;
  font-size: 16px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  transition: border-color 0.2s ease;
  background: white;
}

.scheduleInput:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.itemsList {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.scheduledItem {
  background: white;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease;
}

.scheduledItem:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.itemContent {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.itemDetails {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.trigger {
  color: #666;
  font-size: 14px;
}

.nextTrigger {
  color: #007bff;
  font-size: 14px;
}

.description {
  font-size: 16px;
  color: #333;
  margin-top: 4px;
}

.deleteButton {
  background: none;
  border: none;
  color: #999;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.deleteButton:hover {
  color: #ff4444;
  background-color: rgba(255, 68, 68, 0.1);
}

.toasts-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  min-width: 200px;
  padding: 12px 24px;
  border-radius: 6px;
  color: white;
  font-size: 14px;
  font-weight: 500;
  animation: slideIn 0.3s ease-out forwards;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.toast-success {
  background-color: #28a745;
}

.toast-error {
  background-color: #dc3545;
}

.toast-info {
  background-color: #17a2b8;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* State Component Styles */
.state-container {
  background-color: white;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.state-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.state-section {
  background-color: #f8f9fa;
  border-radius: 6px;
  padding: 12px;
  transition: transform 0.2s ease;
  min-width: 0; /* Prevent grid item overflow */
}

.state-section:hover {
  transform: translateY(-2px);
}

.section-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  color: #444;
}

/* Counter styles */
.counter-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.counter-button {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 4px;
  color: white;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.counter-button-decrease {
  background-color: #dc3545;
}

.counter-button-decrease:hover {
  background-color: #c82333;
}

.counter-button-increase {
  background-color: #28a745;
}

.counter-button-increase:hover {
  background-color: #218838;
}

.counter-value {
  font-size: 24px;
  font-weight: bold;
  color: #333;
  min-width: 3ch;
  text-align: center;
}

/* Text input styles */
.state-input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px;
  border: 2px solid #e0e0e0;
  border-radius: 4px;
  font-size: 14px;
  transition: all 0.2s ease;
}

.state-input:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.1);
}

/* Color picker styles */
.color-picker-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  width: 48px;
  height: 48px;
  margin: 8px auto;
}

.color-picker {
  position: absolute;
  top: 0;
  left: 0;
  width: 48px;
  height: 48px;
  padding: 0;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  opacity: 0;
  z-index: 2;
}

.color-preview {
  position: absolute;
  top: 0;
  left: 0;
  width: 48px;
  height: 48px;
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
  border: 2px solid #e0e0e0;
  z-index: 1;
}

.state-hint {
  text-align: center;
  font-size: 12px;
  color: #666;
  margin-top: 16px;
}

/* Email Component Styles */
.email-container {
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.email-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.chat-section,
.email-section {
  background: #f9f9f9;
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  height: 500px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e0e0e0;
}

.section-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}

.toggle-container {
  display: flex;
  align-items: center;
}

.toggle-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 14px;
}

.toggle-label span {
  margin-right: 8px;
}

.toggle-input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 20px;
  background-color: #ccc;
  border-radius: 20px;
  transition: 0.4s;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  border-radius: 50%;
  transition: 0.4s;
}

.toggle-input:checked + .toggle-slider {
  background-color: #f44336;
}

.toggle-input:checked + .toggle-slider:before {
  transform: translateX(20px);
}

.messages-container,
.emails-container {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.message {
  padding: 10px 12px;
  border-radius: 8px;
  max-width: 80%;
  word-break: break-word;
}

.agent-message {
  align-self: flex-start;
  background-color: #e9e9eb;
}

.user-message {
  align-self: flex-end;
  background-color: #007bff;
  color: white;
}

.message-content {
  margin-bottom: 4px;
}

.message-time {
  font-size: 11px;
  opacity: 0.7;
  text-align: right;
}

.input-form,
.email-form {
  display: flex;
  gap: 8px;
}

.input-form {
  flex-direction: row;
}

.email-form {
  flex-direction: column;
}

.message-input,
.email-subject-input,
.email-body-input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  font-size: 14px;
}

.message-input:disabled {
  background-color: #f5f5f5;
  cursor: not-allowed;
}

.email-body-input {
  min-height: 100px;
  resize: vertical;
}

.send-button {
  padding: 10px 16px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.2s;
}

.send-button:hover {
  background-color: #0069d9;
}

.send-button:disabled {
  background-color: #cccccc;
  cursor: not-allowed;
}

.email-hint {
  font-size: 12px;
  color: #666;
}

.email-item {
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 10px;
}

.agent-email {
  background-color: #f0f0f0;
  border-left: 3px solid #007bff;
}

.user-email {
  background-color: #f9f9f9;
  border-left: 3px solid #28a745;
}

.email-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.email-subject {
  font-weight: 600;
}

.email-time {
  font-size: 12px;
  color: #666;
}

.email-body {
  font-size: 14px;
  white-space: pre-wrap;
}

@media (max-width: 768px) {
  .email-grid {
    grid-template-columns: 1fr;
  }

  .chat-section,
  .email-section {
    height: 400px;
  }
}

.section-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.clear-button {
  background-color: #f1f1f1;
  color: #666;
  border: none;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.clear-button:hover {
  background-color: #e0e0e0;
  color: #333;
}
